(() => {
    // 定义一个接口
    interface IPerson {
        firstName: String,
        lastName: String
    }
    //定义一个类型
    class Person {
        //定义公共的字段（属性）
        firstName: string//姓氏
        lastName: string//名字
        fullName: string//姓名
        //定义一个构造函数
        constructor(firstName: string, lastName: string) {
            //更新属性
            this.firstName = firstName
            this.lastName = lastName
            this.fullName = this.firstName + '-' + this.lastName
        }
    }
    //定义一个函数
    function showFullName(params: IPerson) {
        return params.firstName + '-' + params.lastName
    }
    const person = new Person('诸葛', '孔明')
    console.log(person);
    console.log(showFullName(person));
    
    
})()